import {get,post} from "../utils/request.js"
export function getCurrentUserInfo(){
	return get("/api/pcUser/login-user/info");
}

export function login(username,password){
	return post("/api/pcUser/login",{
		username,
		password,
		rememberMe:true
	}).then(res=>{
		// 记录一下cookie
		// #ifndef H5
			const cookie = res.cookies.join(";")
			if(cookie.includes("JSESSIONID")){
				uni.setStorageSync("cookie",cookie)
			}
		// #endif
		 
		return res;
	})
}


export function logout(){
	return get("/api/pcUser/logout")
}